<?php use_helper('jQuery')?>

<div id="main_header" class="ui-widget-header ui-corner-all">
    <h3>Footer</h3>
</div>
<div id="main_content" class="ui-widget ui-widget-content ui-corner-all">
    <table>
        <?php if($sf_user->hasCredential('Editar footer')): ?>
            <tfoot>
                <tr>
                    <td colspan="3" >
                        <?php echo jq_link_to_remote(
                                '<span class="ui-button-icon-primary ui-icon ui-icon-pencil"></span>
                                <span class="ui-button-text">Editar</span>',
                            array(
                                'update' => 'main',
                                'url' => url_for('portal_footer_edit',$footer),
                                'before'   => 'clearView();showLoaderMain();',
                                'complete' => 'hideLoader();',
                                'script'   => true
                            ), array(
                                'class' => 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary',
                                'title' => 'Editar'
                            ))?>
                    </td>
                </tr>
            </tfoot>
        <?php endif; ?>
        <tbody>
            <tr>
                <th>Utiliza banner:</th>
                <td>
                    <?php if ($footer->getUsesBanner() == true): ?>
                        <img alt="Sí" title="Sí" src="/images/util/check.png">
                    <?php else: ?>
                        <img alt="No" title="No" src="/images/util/cross.png">
                    <?php endif; ?>
                </td>
                <td>
                    <?php echo jq_link_to_remote(
                            '<span class="ui-button-icon-primary ui-icon ui-icon-pencil"></span>
                            <span class="ui-button-text">Editar</span>',
                        array(
                            'update' => 'main',
                            'url' => url_for('portal_footer_edit_banner',$footer)
                        ),
                        array(
                            'class' => 'ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only',
                            'title' => 'Cambiar'
                        ))
                    ?>
                </td>
            </tr>
            <tr>
                <th colspan="3">Pie de página:</th>
            </tr>
            <tr>
                <td colspan="3" >
                    <div><?php echo html_entity_decode($footer->getHtml()) ?></div>
                </td>
            </tr>
        </tbody>
    </table>
</div>